package test;

/*
 * Author: JacksonCoder
 * FileName: damo5
 * Version: 1.0.0
 * Date: 2025/5/9
 */

public class damo5 {

    public static void main(String[] args) {

        //1. byte
        byte bPr = 10;
        // boxing
        Byte bBox = bPr;
        // UnBox
        byte bUn = bBox;
        System.out.println("byte -> Byte -> byte: " + bPr + " -> " + bBox + " -> " + bUn);


        //2. short
        short sPr = 20;
        Short sBox = sPr;
        short sUn = sBox;
        System.out.println("short -> Short -> short: " + sPr + " -> " + sBox + " -> " + sUn);

        // 3. int
        int iPr = 30;
        Integer iBox = iPr;    // 装箱
        int iUn = iBox;        // 拆箱
        System.out.println("int → Integer → int: " + iPr + " → " + iBox + " → " + iUn);

        // 4. long
        long lPr = 40L;
        Long lBox = lPr;       // 装箱
        long lUn = lBox;       // 拆箱
        System.out.println("long → Long → long: " + lPr + " → " + lBox + " → " + lUn);

        // 5. float
        float fPr = 3.14f;
        Float fBox = fPr;      // 装箱
        float fUn = fBox;      // 拆箱
        System.out.println("float → Float → float: " + fPr + " → " + fBox + " → " + fUn);

        // 6. double
        double dPr = 6.28;
        Double dBox = dPr;     // 装箱
        double dUn = dBox;     // 拆箱
        System.out.println("double → Double → double: " + dPr + " → " + dBox + " → " + dUn);

        // 7. char
        char cPr = 'A';
        Character cBox = cPr;  // 装箱
        char cUn = cBox;       // 拆箱
        System.out.println("char → Character → char: " + cPr + " → " + cBox + " → " + cUn);

        // 8. boolean
        boolean boolPr = true;
        Boolean boolBox = boolPr;  // 装箱
        boolean boolUn = boolBox;  // 拆箱
        System.out.println("boolean → Boolean → boolean: " + boolPr + " → " + boolBox + " → " + boolUn);

    }

}
